/*
* @Author: LAPTOP-MEHUV51O\h
* @Date:   2018-05-14 17:41:25
* @Last Modified by:   LAPTOP-MEHUV51O\h
* @Last Modified time: 2018-05-14 17:54:03
*/
//检测是否为英文和数字 
jQuery.validator.addMethod("isChar", function(value, element) {  
    var length = value.length;  
    var regName = /^[a-z0-9]+$/i;  
    return this.optional(element) || regName.test( value );    
}, "请输入英文或数字");  
//检测用户姓名是否为英文和数字 
jQuery.validator.addMethod("isIP", function(value, element) {  
    var length = value.length;  
    var regName = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;  
    return this.optional(element) || regName.test( value );    
}, "请正确填写IP");  
